home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 September / 1984-09.d64 / disk tricks 1 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  933b  |  21 lines

  1. 100 sys65517:ifpeek(781)=22thenmt$="":goto500
  2. 110 mt$=""
  3. 500 print"[147]"mt$"     warning"
  4. 501 print" this program will":print" change the disk"
  5. 502 print" name. please make":print" sure that the"
  6. 503 print" gazette disk[146] is not":print" in the drive."
  7. 998 fori=1to6000:next
  8. 999 rem end: rem program 1: change disk name
  9. 1000 input "[147]new disk name";dn$
  10. 1010 if len(dn$)<16 then dn$=dn$+chr$(160):goto 1010:rem stretch to 16 chars
  11. 1020 if len(dn$) > 16 then dn$=left$(dn$,16): rem shorten name to 16 characters
  12. 1030 open 15,8,15,"i": rem open disk command channel
  13. 1040 open 8,8,8,"#": rem open direct access channel
  14. 1050 print#15, "u1:"8;0;18;0: rem read track 18, sector 0 into channel 8 buffer
  15. 1060 print#15, "b-p:"8;144: rem move buffer-pointer to first byte of disk name
  16. 1070 print#8, dn$;: rem put new name in channel 8 buffer, replacing old name
  17. 1080 print#15,"u2:"8;0;18;0:rem write buffer with name changed
  18. 1090 close 8: rem close direct access channel
  19. 1100 close15: rem close command channel
  20. 1110 rem goto 100: rem restart display t&s program if appended
  21.